using Koala.Pro.Common;
using System.Globalization;
using System.Windows.Data;

namespace Koala.Pro.Helpers;

public class NumberToUsedStrReConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        int? num = value.ToIntOrNull();
        if (!num.HasValue)
        {
            return "";
        }
        if (!num.HasValue || !(num > 0))
        {
            return "停用";
        }
        return "正常";
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
